#include "N79E81x.h"
#include <stdio.h>
#include "Typedef.h"
#include "Delay.h"
#include "Dh11.h"
#include "Common.h"
#define uint unsigned int
#define uchar unsigned  char

void getDistance ()//获取距离
{
	static UINT16 time_cnt;
   while(!DATA_PIN){}//等待电平边高
		 time_cnt =0;
		while(DATA_PIN){
      Delay10us(1);
			time_cnt++;
			}
			distance  = time_cnt*0.34;//10 us传播的距离为0.34cm
}
